package week_8;

import java.util.Iterator;

//测试用链表实现的堆再来实现的队列。
public class HeapQueueTest {
    public static void main(String[] args) {
        HeapQueue queue = new HeapQueue();

        queue.enqueue(20);
        queue.enqueue(17);
        queue.enqueue(23);
        queue.enqueue(28);
        System.out.print("入队后的队列为：");
            Iterator iterator = queue.iteratorLevelOrder();
            while(iterator.hasNext())
            {
                System.out.print(iterator.next()+ " ");
            }
        System.out.println();
        System.out.println("用堆表示为：");
        System.out.println(queue);

        queue.dequeue();
        System.out.println("删除队列中一个元素为：");
            Iterator iterator1 = queue.iteratorLevelOrder();
            while(iterator1.hasNext())
            {
               System.out.print(iterator1.next()+ " ");
            }
        System.out.println(queue);
    }

}
